<!doctype html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>Document</title>
 <script src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script>
</head>
<body>
<button onclick="requestUser()">requestUser</button><br/><br/>
<button onclick="logout()">logout</button><br/><br/>
<button onclick="startRecord()">startRecord</button><br/><br/>
<button onclick="isRecording()">isRecording</button><br/><br/>
<button onclick="stopRecord()">stopRecord</button><br/><br/>
<button onclick="callScanFace()">callScanFace</button><br/><br/>
<button onclick="callNFC()">callNFC</button><br/><br/>
<button onclick="checkNFC()">checkNFC</button><br/><br/>
<button onclick="playAudio()">playAudio</button><br/><br/>
<button onclick="stopAudio()">stopAudio</button><br/><br/>
<button onclick="pickImage(2,60)">pickImage</button><br/><br/>
<button onclick="pickImageToHash(2,60)">pickImageToHash</button><br/><br/>
<button onclick="openSmartService()">openSmartService</button><br/><br/>
<button onclick="playMp3()">playMp3</button><br/><br/>
<button onclick="hideKeyBoard()">hideKeyBoard</button><br/><br/>
<button onclick="getCurrentPage()">getCurrentPage</button><br/><br/>
<button onclick="signSbk()">signSbk</button><br/><br/>
<div> //获取极光推送id </div>
<button onclick="getRegistrationID()">点击获取RegistrationID </button><br/><br/>
<div><span id="RegistrationID" style="display:inline-block;width:80%;word-wrap:break-word;white-space:normal;"></span>
</div>
<div>
 <button onclick="getAlipay()">点击获取调起支付接口 </button><br/><br/>
 <span id="payinfo" style="display:inline-block;width:80%;word-wrap:break-word;white-space:normal;"></span>
</div>
<div>
 <button onclick="getSignature()">点击调用签名 </button><br/><br/>
 <span id="Signature" style="display:inline-block;width:80%;word-wrap:break-word;white-space:normal;"></span>
</div>



<a href='http://106.12.180.103/flutter02.html'>http://106.12.180.103/flutter02.html</a>
<input type='text'/><br/><br/>
<input type='password'/><br/><br/>
<audio src="http://106.12.180.103/tt.mp3" controls="controls" style="max-width:100%;"></audio>
<audio src="http://116.62.151.9:81/voices/20190822/20190822172320254TTS.mp3" id="yunMp3" controls="controls" style="max-width:100%;"></audio>

<p id="p1"></p>
<span id="message" style="display:inline-block;width:80%;word-wrap:break-word;white-space:normal;"></span>


</body>
<script type='text/javascript'>

    var vConsole = new VConsole();

    //请求获取用户信息，H5端调用，调用后原生端会调用以下“getUser()” 将userInfo传递过来
    function requestUser(){
        document.location = "js://webview/queryUser";
    }
    //获取用户信息
    function getUser(userInfo){
        document.getElementById("p1").innerHTML=userInfo;
        return 'OK';
    }

    //退出登陆
    function logout(){
        App.postMessage('logout');
    }
    //开始录制音频
    function startRecord(){
        Recorder.postMessage("start");
    }
    //开始录制音频---接收反馈
    function startRecordBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //是否正在录制音频
    function isRecording(){
        Recorder.postMessage("isRecording");
    }
    //是否正在录制音频---接收反馈
    function isRecordingBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //停止录制音频
    function stopRecord(){
        Recorder.postMessage("stop");
    }
    //停止录制音频---接收反馈base64码
    function stopRecordBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }

    //调出扫描人脸界面
    function callScanFace(){
        App.postMessage('callScanFace:此操作需要进行人脸识别');
    }
    //调出扫描人脸界面--接收扫描结果
    function callScanFaceBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //开始nfc扫描卡,多次扫卡需要多次调用
    function callNFC(){
        App.postMessage('callNFC');
    }
    //nfc扫描卡--接收扫描结果
    function callNFCBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //判断NFC状态
    function checkNFC(){
        App.postMessage('checkNFC');
    }
    //判断NFC状态--接收结果，NOT_SUPPORT：不支持nfc，NOT_ENABLE：支持nfc但未开启，ENABLE：支持且已经开启
    function checkNFCBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //获取当前页标题
    function getCurrentPage(){
        App.postMessage('getCurrentPage');
    }
    //获取当前页标题--接收结
    function getCurrentPageBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //获取照片 type:取照方式,int,1--拍照获取;2--相册获取       imageQuality:图像质量,int,范围[0-100]
    function pickImage(type,imageQuality){
        App.postMessage('pickImage:'+type+':'+imageQuality);
    }
    //获取照片及hash结果 type:取照方式,int,1--拍照获取;2--相册获取       imageQuality:图像质量,int,范围[0-100]
    function pickImageToHash(type,imageQuality){
        App.postMessage('pickImageToHash:'+type+':'+imageQuality);
    }
    //获取照片返回信息base64码
    function pickImageBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //开始播放音乐
    function playAudio(){
        //var url='http://106.12.180.103/tt.mp3';
        var url='http://116.62.151.9:81/voices/20190822/20190822172320254TTS.mp3';

        App.postMessage('playAudio:'+url);
    }
    //停止播放音乐
    function stopAudio(){
        App.postMessage('stopAudio');
    }
    //判断是否正在播放音乐
    function isPlayingAudio(){
        App.postMessage('isPlayingAudio');
    }
    //隐藏键盘
    function hideKeyBoard(){
        App.postMessage('hideKeyBoard');
    }
    //判断是否正在播放音乐,回调，放到jquery外面
    function isPlayingAudioBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //打开智能客服
    function openSmartService(){
        var url='https://demo2.faqrobot.net/robot/h5chat_WD.html?sysNum=15155618951052101&receiveId=&sourceId=30081';
        App.postMessage('openSmartService:'+url);
    }
    function playMp3(){
        document.getElementById('yunMp3').play();
    }
    //播放完毕回调
    function endPlayAudio(){
        document.getElementById("message").innerHTML='play completed!';
    }

    //获取极光推送id
    function getRegistrationID(){
        App.postMessage("RegistrationID");
    }
    function writeRegistrationID(message)
    {

        document.getElementById("RegistrationID").innerHTML="RegistrationID: "+message;
    }


    function getAlipay()
    {
        App.postMessage("Alipay:alipay_sdk=alipay-sdk-java-4.8.10.ALL&app_id=2016101200667520&biz_content=%7B%22out_trade_no%22%3A%221571380854254%22%2C%22passback_params%22%3A%22%25E5%2585%25AC%25E7%2594%25A8%25E5%259B%259E%25E4%25BC%25A0%25E5%258F%2582%25E6%2595%25B0%25E6%25B5%258B%25E8%25AF%2595123%252334%25EF%25BC%2581%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22subject%22%3A%22app%E6%94%AF%E4%BB%98subject%E6%B5%8B%E8%AF%95%22%2C%22total_amount%22%3A%2210000.00%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&sign=MC3C0IFDGUoI8mMMwVK%2BR1Rqv1H%2BE7IN1nQtX2bcIatMEDZQUYtvZ6hxJA4Cz%2F78kJsWQ3vpr%2FR%2FlRtkcTNkFsNodvrfsdC2eaVBy%2FSU9N3Qso8DDCccFU6m32G%2FdCGc2ZGuo4fAm%2Bt%2FWcUFaQJr1%2BQEohZpBNVg5BY1DvTA6ku%2FBwQWSTWxPPi%2FR5tKMhS1DdVDE6QWp42DzdAm4NyTMQXxKMCJ0ndOYKzMqJESQAuwl5AyRzaSvvIqVSr%2F3ReJTUA4Dr6%2FMi3qUubJo7TW1mJ1tBLRIZU7xNpXv2PkqkYaDZbjiDFsI5DjWt9Hx40lnupCozPetJEok%2FH4yOOnNQ%3D%3D&sign_type=RSA2&timestamp=2019-10-18+14%3A40%3A54&version=1.0"
        );

    }
    function writeAlipay(message)
    {
        //message 为app向界面传送的数据
        document.getElementById("payinfo").innerHTML=message;
    }

    function getSignature()
    {
        App.postMessage("Signature" );

    }
    function writeSignature(message)
    {
        //message 为app向界面传送的数据
        document.getElementById("Signature").innerHTML=message;
    }

    //照片hash--接收结果
    function hashImageBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
    //社保卡签名
    function signSbk(){
        App.postMessage('signSbk');
    }
    //社保卡签名--接收结果
    function signSbkBackInfo(message){
        document.getElementById("message").innerHTML=message;
    }
</script>
</html>
